import { createRouter, createWebHistory } from 'vue-router'
import type { RouteRecordRaw } from 'vue-router'
let routes: RouteRecordRaw[] = [
  {
    path: "/",
    redirect: "/login"
  },
  {
    path: "/login",
    name: "login",
    component: () => import("@/views/login/index.vue")
  },
  {
    path: "/layout",
    name: "layout",
    component: () => import("@/views/layout/index.vue"),
    children: [
      { //部门管理
        path: "dept",
        name: "dept",
        component: () => import("@/views/dept/index.vue")
      },
      { //用户模块
        path: "user",
        name: "user",
        component: () => import("@/views/user/index.vue")
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router